home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / MultiSession 1.04 Source / Core 27⁄June⁄1993 / CPicture.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-16  |  1.8 KB  |  60 lines  |  [TEXT/KAHL]

  1. /* CIcon.c */
  2.  
  3. #include "CPicture.h"
  4. #include "CWindow.h"
  5.  
  6.  
  7. /* initialize the button */
  8. void            CPicture::IPicture(LongPoint Start, LongPoint Extent, short ThePicture,
  9.                         short ThePictureSelected, char Key, short Modifiers, CWindow* TheWindow,
  10.                         CEnclosure* TheEnclosure)
  11.     {
  12.         ERROR(Initialized == True,PRERR(ForceAbort,
  13.             "CPicture::IPicture called on already initialized object."));
  14.         EXECUTE(Initialized = True);
  15.         Picture = ThePicture;
  16.         PictureSelected = ThePictureSelected;
  17.         IButton(Start,Extent,Key,Modifiers,TheWindow,TheEnclosure);
  18.     }
  19.  
  20.  
  21. void            CPicture::RedrawNormal(void)
  22.     {
  23.         PicHandle        Pic;
  24.  
  25.         ERROR(Initialized != True,PRERR(ForceAbort,
  26.             "CPicture::RedrawNormal called on uninitialized object."));
  27.         SetUpPort();
  28.         ERROR(ResLoad == 0,PRERR(ForceAbort,"Automatic resource loading is disabled."));
  29.         Pic = (PicHandle)GetResource('PICT',Picture);
  30.         ERROR(Pic==NIL,PRERR(ForceAbort,
  31.             "CPicture::RedrawNormal passed an undefined PICT resource ID."));
  32.         ERROR(ResErr != noErr,PRERR(ForceAbort,"Resource Error occurred."));
  33.         Window->LDrawPicture(Pic,ZeroPoint,Extent);
  34.         if (!Enabled)
  35.             {
  36.                 Window->SetPen(1,1,patBic,gray);
  37.                 Window->LPaintRect(ZeroPoint,Extent);
  38.             }
  39.     }
  40.  
  41.  
  42. void            CPicture::RedrawHilited(void)
  43.     {
  44.         PicHandle        Pic;
  45.  
  46.         ERROR(Initialized != True,PRERR(ForceAbort,
  47.             "CPicture::RedrawHilited called on uninitialized object."));
  48.         SetUpPort();
  49.         ERROR(ResLoad == 0,PRERR(ForceAbort,"Automatic resource loading is disabled."));
  50.         Pic = (PicHandle)GetResource('PICT',PictureSelected);
  51.         ERROR(Pic==NIL,PRERR(ForceAbort,"CPicture::RedrawHilited passed an undefined PICT resource ID."));
  52.         ERROR(ResErr != noErr,PRERR(ForceAbort,"Resource Error occurred."));
  53.         Window->LDrawPicture(Pic,ZeroPoint,Extent);
  54.         if (!Enabled)
  55.             {
  56.                 Window->SetPen(1,1,patBic,gray);
  57.                 Window->LPaintRect(ZeroPoint,Extent);
  58.             }
  59.     }
  60.